Optimal. Leaf size=144 \[ -\left (\left (b d \left (3 c^2-d^2\right )-a \left (c^3-3 c d^2\right )\right ) x\right )-\frac {\left (b c^3+3 a c^2 d-3 b c d^2-a d^3\right ) \log (\cos (e+f x))}{f}+\frac {d \left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(b c+a d) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 144, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3609, 3606,
3556} \begin {gather*} \frac {d \left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}-x \left (b d \left (3 c^2-d^2\right )-a \left (c^3-3 c d^2\right )\right )-\frac {\left (3 a c^2 d-a d^3+b c^3-3 b c d^2\right ) \log (\cos (e+f x))}{f}+\frac {(a d+b c) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3606
Rule 3609
Rubi steps
\begin {align*} \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx &=\frac {b (c+d \tan (e+f x))^3}{3 f}+\int (c+d \tan (e+f x))^2 (a c-b d+(b c+a d) \tan (e+f x)) \, dx\\ &=\frac {(b c+a d) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f}+\int (c+d \tan (e+f x)) \left (-2 b c d+a \left (c^2-d^2\right )+\left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)\right ) \, dx\\ &=-\left (b d \left (3 c^2-d^2\right )-a \left (c^3-3 c d^2\right )\right ) x+\frac {d \left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(b c+a d) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f}+\left (b c^3+3 a c^2 d-3 b c d^2-a d^3\right ) \int \tan (e+f x) \, dx\\ &=-\left (b d \left (3 c^2-d^2\right )-a \left (c^3-3 c d^2\right )\right ) x-\frac {\left (b c^3+3 a c^2 d-3 b c d^2-a d^3\right ) \log (\cos (e+f x))}{f}+\frac {d \left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(b c+a d) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.03, size = 130, normalized size = 0.90 \begin {gather*} \frac {3 (-i a+b) (c+i d)^3 \log (i-\tan (e+f x))+3 (i a+b) (c-i d)^3 \log (i+\tan (e+f x))+6 d \left (3 b c^2+3 a c d-b d^2\right ) \tan (e+f x)+3 d^2 (3 b c+a d) \tan ^2(e+f x)+2 b d^3 \tan ^3(e+f x)}{6 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 159, normalized size = 1.10
method | result | size |
norman | \(\left (a \,c^{3}-3 a c \,d^{2}-3 b \,c^{2} d +b \,d^{3}\right ) x +\frac {d \left (3 a c d +3 b \,c^{2}-b \,d^{2}\right ) \tan \left (f x +e \right )}{f}+\frac {b \,d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {d^{2} \left (a d +3 b c \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {\left (3 a \,c^{2} d -a \,d^{3}+b \,c^{3}-3 b c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}\) | \(141\) |
derivativedivides | \(\frac {\frac {b \,d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {a \,d^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {3 b c \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+3 a c \,d^{2} \tan \left (f x +e \right )+3 b \,c^{2} d \tan \left (f x +e \right )-b \,d^{3} \tan \left (f x +e \right )+\frac {\left (3 a \,c^{2} d -a \,d^{3}+b \,c^{3}-3 b c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a \,c^{3}-3 a c \,d^{2}-3 b \,c^{2} d +b \,d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{f}\) | \(159\) |
default | \(\frac {\frac {b \,d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {a \,d^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {3 b c \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+3 a c \,d^{2} \tan \left (f x +e \right )+3 b \,c^{2} d \tan \left (f x +e \right )-b \,d^{3} \tan \left (f x +e \right )+\frac {\left (3 a \,c^{2} d -a \,d^{3}+b \,c^{3}-3 b c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a \,c^{3}-3 a c \,d^{2}-3 b \,c^{2} d +b \,d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{f}\) | \(159\) |
risch | \(a \,c^{3} x -3 a c \,d^{2} x -3 b \,c^{2} d x +b \,d^{3} x +\frac {6 i a \,c^{2} d e}{f}-3 i b c \,d^{2} x -\frac {6 i b c \,d^{2} e}{f}+i b \,c^{3} x -i a \,d^{3} x +\frac {2 i d \left (9 a c d \,{\mathrm e}^{4 i \left (f x +e \right )}+9 b \,c^{2} {\mathrm e}^{4 i \left (f x +e \right )}-6 b \,d^{2} {\mathrm e}^{4 i \left (f x +e \right )}-3 i a \,d^{2} {\mathrm e}^{4 i \left (f x +e \right )}-9 i b c d \,{\mathrm e}^{4 i \left (f x +e \right )}+18 a c d \,{\mathrm e}^{2 i \left (f x +e \right )}+18 b \,c^{2} {\mathrm e}^{2 i \left (f x +e \right )}-6 b \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-3 i a \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-9 i b c d \,{\mathrm e}^{2 i \left (f x +e \right )}+9 a c d +9 b \,c^{2}-4 b \,d^{2}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}+\frac {2 i b \,c^{3} e}{f}+3 i a \,c^{2} d x -\frac {2 i a \,d^{3} e}{f}-\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a \,c^{2} d}{f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a \,d^{3}}{f}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b \,c^{3}}{f}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b c \,d^{2}}{f}\) | \(383\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.71, size = 148, normalized size = 1.03 \begin {gather*} \frac {2 \, b d^{3} \tan \left (f x + e\right )^{3} + 3 \, {\left (3 \, b c d^{2} + a d^{3}\right )} \tan \left (f x + e\right )^{2} + 6 \, {\left (a c^{3} - 3 \, b c^{2} d - 3 \, a c d^{2} + b d^{3}\right )} {\left (f x + e\right )} + 3 \, {\left (b c^{3} + 3 \, a c^{2} d - 3 \, b c d^{2} - a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (3 \, b c^{2} d + 3 \, a c d^{2} - b d^{3}\right )} \tan \left (f x + e\right )}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.19, size = 146, normalized size = 1.01 \begin {gather*} \frac {2 \, b d^{3} \tan \left (f x + e\right )^{3} + 6 \, {\left (a c^{3} - 3 \, b c^{2} d - 3 \, a c d^{2} + b d^{3}\right )} f x + 3 \, {\left (3 \, b c d^{2} + a d^{3}\right )} \tan \left (f x + e\right )^{2} - 3 \, {\left (b c^{3} + 3 \, a c^{2} d - 3 \, b c d^{2} - a d^{3}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 6 \, {\left (3 \, b c^{2} d + 3 \, a c d^{2} - b d^{3}\right )} \tan \left (f x + e\right )}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.15, size = 240, normalized size = 1.67 \begin {gather*} \begin {cases} a c^{3} x + \frac {3 a c^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 a c d^{2} x + \frac {3 a c d^{2} \tan {\left (e + f x \right )}}{f} - \frac {a d^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {b c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 b c^{2} d x + \frac {3 b c^{2} d \tan {\left (e + f x \right )}}{f} - \frac {3 b c d^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 b c d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + b d^{3} x + \frac {b d^{3} \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac {b d^{3} \tan {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \left (a + b \tan {\left (e \right )}\right ) \left (c + d \tan {\left (e \right )}\right )^{3} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 2046 vs.
\(2 (144) = 288\).
time = 1.34, size = 2046, normalized size = 14.21 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.23, size = 142, normalized size = 0.99 \begin {gather*} x\,\left (a\,c^3-3\,b\,c^2\,d-3\,a\,c\,d^2+b\,d^3\right )-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (b\,d^3-3\,c\,d\,\left (a\,d+b\,c\right )\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a\,d^3}{2}+\frac {3\,b\,c\,d^2}{2}\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (-\frac {b\,c^3}{2}-\frac {3\,a\,c^2\,d}{2}+\frac {3\,b\,c\,d^2}{2}+\frac {a\,d^3}{2}\right )}{f}+\frac {b\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________